import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store =new Vuex.Store({
  state: {
    formDatas: null,
    token: 1
  },
  mutations: {
    getFormdata(state, data) {
      state.formDatas = data;
    },
    saveToken(state,data){
      state.token=data;
      window.localStorage.setItem("Token",data);  //就是这里，保存到了 localStorage 中
    }
  }
})

// 输出模块
export default store;
